#include "IMG.h"
#include "BMPreader.h"
#include "BMPwriter.h"


int main(int argc, char** argv){
	IMG img;
	FILE * bmp = fopen("src.bmp","rb");
	if (bmp == NULL){
		printf("Error when open file!\n");
		system("pause");
		return 0;
	}
	readBMP(&img, bmp);
	if (img.empty){
		printf("Error when read BMP!\n");
		system("pause");
		return 0;
	}
	fclose(bmp);
	bmp = fopen("dst.bmp", "wb");
	if (bmp == NULL){
		printf("Error when create file!\n");
		system("pause");
		return 0;
	}
	writeBMP(&img, bmp);
	freeIMG(&img);
	fclose(bmp);

	return 0;
}